package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**用于大图显示的图片
 * @author ZhangGuiyou
 * Date: 2015-8-10 09:55
 */
public class Img extends XtomObject implements Serializable {

	private static final long serialVersionUID = 1L;

	private String id;
	private String imgurlbig;//大图地址
	private String imgurl;//小图地址

	
	/**一般使用这个构造方法
	 * @param imgurlbig
	 */
	public Img(String imgurlbig) {
		super();
		this.imgurlbig = imgurlbig;
	}

	public Img(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				imgurlbig = get(jsonObject, "imgurlbig");
				id = get(jsonObject, "id");
				imgurl = get(jsonObject, "imgurl");
				
				log_i(toString());
			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}

	@Override
	public String toString() {
		return "Img [id=" + id + ", imgurlbig=" + imgurlbig + ", imgurl=" + imgurl + "]";
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getImgurl() {
		return imgurl;
	}

	public void setImgurl(String imgurl) {
		this.imgurl = imgurl;
	}

	public String getImgurlbig() {
		return imgurlbig;
	}

	public void setImgurlbig(String imgurlbig) {
		this.imgurlbig = imgurlbig;
	}
}
